home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / progtool / modula2 / module / brain.mod < prev    next >
Text File  |  1995-11-25  |  4KB  |  107 lines

  1. MODULE BRAIN;
  2. (* Version*: 20.12.89   04:35*)
  3.  
  4. FROM EasyDialog IMPORT and;
  5. FROM MenuEvnt IMPORT MINDMENU,MenueEreignis;
  6. FROM Liste IMPORT KillList;
  7. FROM MBIO IMPORT MBList;
  8. FROM SYSTEM IMPORT ADR,ADDRESS,VAL,SHIFT;
  9. FROM KbdEvnt IMPORT MenuSearch;
  10.  
  11. FROM AES IMPORT ApplInitialise,ApplExit,ResourceLoad,ResourceGetAddr,MenuBar,
  12. GrafMouse,EventMultiple,ResourceFree,GrafHandle,FormDialogue;
  13.  
  14. FROM GEMAESbase IMPORT Arrow,HourGlass,FormStart,FormFinish,
  15.                 MesageEvent,TimerEvent,KeyboardEvent;
  16. FROM GEMVDIBase IMPORT VDIWorkInType,VDIWorkOutType;
  17. FROM VDIControls IMPORT OpenVirtualWorkstation,CloseVirtualWorkstation;
  18.  
  19.  
  20.  
  21. VAR ENDE                      : BOOLEAN;
  22.     menueadresse,MouseAdresse : ADDRESS;
  23.     id,handle,j,MaxX,MaxY     : INTEGER;
  24.     RSCfileName               : ARRAY[1..12] OF CHAR;
  25.     OK                        : BOOLEAN;
  26.     taste                     : CHAR;
  27.     WorkIn                    : VDIWorkInType;
  28.     WorkOut                   : VDIWorkOutType;
  29.     WC,HC,WB,HB               : INTEGER;
  30.  
  31.  
  32. PROCEDURE Auswahl;
  33.  
  34. VAR
  35. mBuf :ARRAY [0..7] OF INTEGER;
  36. formret,msgret : INTEGER;
  37. events,flag,mx,my,mbutton,mstate,scancode,mclicks:INTEGER;
  38. String : ARRAY [1..120] OF CHAR;
  39. BEGIN
  40. flag :=MesageEvent+TimerEvent+KeyboardEvent;
  41. REPEAT
  42.  ENDE := FALSE;
  43.  
  44.  events:=EventMultiple(flag,0,0,0,0,0,0,0,0,0,0,0,0,0,
  45.                        ADR(mBuf),10000,0,(* Timer Event*)
  46.                        mx,my,
  47.                        mbutton,mstate,scancode,mclicks);
  48. IF and(events,MesageEvent)THEN
  49.  msgret :=mBuf[4];
  50.      ENDE := MenueEreignis(msgret,menueadresse);
  51.  END(*IF*);
  52.  IF and(events,TimerEvent) THEN
  53.      (**********************************************************************************************************)
  54.      (*String :='[0][ TimerEvent | Nur zum Test!!!!! |  Christian   Ledermann| ver 0.0 vom 25.02.93 ][  OK  ]';*)
  55.      (*formret:=FormAlert(1,String);                                                                           *)
  56.      (**********************************************************************************************************)
  57.  END(*IF*);
  58.  IF and(events,KeyboardEvent) THEN
  59.     IF ~MenuSearch(id,menueadresse,mstate,scancode,taste) THEN
  60.        (* Eigene Tastaturabfrage*)
  61.        IF taste=33C THEN (* ESC-Taste gedrückt!*)
  62.            (* Sehr praktisch wenn man mit dem Debugger arbeitet          *)
  63.            (* Im Normalfall erscheint wenn man den Debugger verlässt     *)
  64.            (* das Menü des M2Loaders. Nach einem Druck auf die ESC-Taste *)
  65.            (* ist nun das eigene Menü wieder da, ausserdem wird ein      *)
  66.            (* Redraw für den ganzen Bildschirm erzwungen                 *)
  67.  
  68.            (* Menü auschalten *)
  69.            MenuBar(menueadresse,0);
  70.            (* Hier wird ein Komplett Redraw erzwungen ! *)
  71.            FormDialogue(FormStart,0,0,0,0,0,0,MaxX,MaxY);
  72.            FormDialogue(FormFinish,0,0,0,0,0,0,MaxX,MaxY);
  73.            (* Menü wieder einschalten *)
  74.            MenuBar(menueadresse,1);
  75.  
  76.        END(*IF*);
  77.     END(*IF*);
  78.  
  79.  END(*IF*);
  80.  
  81.  
  82. UNTIL ENDE
  83.  
  84.  
  85. END Auswahl;
  86.  
  87. BEGIN
  88.     id := ApplInitialise();
  89.     RSCfileName :='BRAIN.rsc';
  90.     ResourceLoad(RSCfileName);
  91.     ResourceGetAddr(0,MINDMENU,menueadresse);
  92.     handle:=GrafHandle(WC,HC,WB,HB);
  93.     FOR j:= 0 TO 9 DO WorkIn[j]:=0 END(*FOR*);
  94.     WorkIn[10]:=2;
  95.     OpenVirtualWorkstation(WorkIn,handle,WorkOut);
  96.     MaxX:=WorkOut[0];
  97.     MaxY:=WorkOut[1];
  98.  
  99.     MenuBar(menueadresse,1);
  100.     GrafMouse(Arrow,NIL);
  101.     Auswahl;
  102.     KillList(MBList);
  103.     CloseVirtualWorkstation(handle);
  104.     ResourceFree;
  105.     ApplExit;
  106. END BRAIN.
  107.